import { Route, Routes, BrowserRouter } from "react-router-dom";
import routes from "./route";

const Router = () => (
  <BrowserRouter>
    <Routes>
      {routes.map(route => (
        <Route
          key={route.key}
          path={route.path}
          element={<route.component />}
        />
      ))}
    </Routes>
  </BrowserRouter>
);

export default Router;
